package com.wing.user.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户角色
 *
 * @author
 */
@Data
@TableName("use_user_role")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserRole extends Model<UserRole> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JsonSerialize(using= ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    protected Long id;

    /**
     * 用户id
     */
    @JsonSerialize(using= ToStringSerializer.class)
    protected Long userId;

    /**
     * 角色id
     */
    @JsonSerialize(using= ToStringSerializer.class)
    protected Long roleId;

    /**
     * 创建时间
     */
    protected LocalDateTime createTime;

    /**
     * 创建人
     */
    protected String creatorName;

    protected LocalDateTime modifierName;

}